Solid-state drives (SSDs) generally have faster performance, are more compact, and are less sensitive to vibration or physical shock than conventional magnetic disk drives. Given these advantages, SSDs are being used in more and more computing devices and other consumer products in lieu of or in addition to magnetic disk drives, even though the cost-per-gigabyte storage capacity of SSDs is significantly higher than that of magnetic disk drives.
Peripheral Component Interconnect Express (“PCIe”) is a standard that specifies the architecture of a communication fabric, and associated protocols, for communication between peripheral devices and the central processing unit (“CPU”) within a computer system. Devices connected to the PCIe fabric direct communications to other devices by providing a PCIe address. The fabric routes such communications to the appropriate device based on this address.
One portion of the address is a device number that specifies the physical device to which a communication is to be routed. Another portion of the address is a function number that specifies the “function” within the specified device to which the communication is directed. The functionality that is associated with any particular function is defined by each individual peripheral device.
Recent modifications to the PCIe specification have introduced the concept of virtual functions (as opposed to physical functions). Virtual functions represent an additional addressing parameter by which a CPU may specify a subdivision of functionality within a peripheral device. More specifically, each physical function may be associated with a set of virtual functions. The virtual functions associated with any particular physical function can be thought of as “clones” in that virtual functions are essentially multiple parallel channels that each provides access to functionality of a single physical function.
Virtual functions are typically used by a host system in which multiple virtual machines that each comprises a software emulation of a physical computer, are running. For any particular physical function, each virtual function is assigned to a different virtual machine. This assignment allows each virtual machine to independently address the peripheral device.
Peripheral devices, such as SSDs, include a number of different types of internal resources, such as queues, buffers, registers, and the like. Typically, these resources are divided between virtual functions in a fixed manner. More specifically, each virtual function is assigned a specific, fixed portion of each resource.
One issue with assigning resources to virtual functions in a fixed manner is that the specific assignment of resources to virtual functions is not necessarily in line with the manner in which a particular computer system utilizes the peripheral device. For example, a peripheral device may support eight virtual functions and thus divide internal resources into eight separate “chunks.” However, a computer system may only execute four virtual machines. Because those virtual machines would only use four virtual functions, resources assigned to other non-used virtual functions would be wasted.